﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FightTheDragon.Managers;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace FightTheDragon.Interface
{
    //Image Class is used for the cursor and Backgrounds
    class Image : BaseInterfaceObjects
    {

        private string m_Texture;
        public string Texture
        {
            get { return m_Texture; }
            set { m_Texture = value; }
        }
        public Image()
        {
            Rotate = 0;
            m_Texture = null;
            Scale = 0;
            RotationRate = 0;
            Color = new Color();
            Position = new Vector2();
            Origin = new Vector2();
        }

        public Image(int x, int y, float rot, string texture, float scale, Color c, float Rate)
        {

            Rotate = rot;
            Texture2D  temp = GlobalContentManager.Instance.Texture(texture);
            m_Texture = texture;
            Scale = scale;
            float height = temp.Height;
            float width = temp.Width;
            RotationRate = Rate;
            Color = c;
           
            Position = new Vector2(x,  y);
            Origin = new Vector2(0,0);
        }

        public override void Render()
        {

            
            
            
            GlobalContentManager.Instance.Sprites.Draw(GlobalContentManager.Instance.Texture(m_Texture)
                , Position, null, Color, Rotate*3.14f/180,Origin,Scale, 0, 0);
            
            
        }

        public override void Update(float gTime)
        {

            Rotate += RotationRate ;
        }
    }
}
